import os
import time
from machine import Pin
import network

def  wifi_init(ssid, password):
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    time.sleep(3);
    if not wlan.isconnected():
        print('connecting to network...')
        wlan.connect()
        while not wlan.isconnected():
            time.sleep(1);
    print('network config:', wlan.ifconfig());

if __name__ == '__main__':
	wifi_init('aaaoppo', '12345678')